roundedrect: Fix coordinate mixup in contains_point
authorTimm Bäder <mail@baedert.org>
Sat, 3 Feb 2018 22:14:16 +0000 (23:14 +0100)
committerTimm Bäder <mail@baedert.org>
Sun, 4 Feb 2018 13:56:41 +0000 (14:56 +0100)
This together with the optimizations in GtkSnapshot was causing circular
buttons to become squared when partially scrolled out of view.

gsk/gskroundedrect.c

index ce9757eff0afa72dbb6b353ae4f3108122a8a3b3..382d56a835118efe7b8732b2186fbed3a223000b 100644 (file)
@@ -362,7 +362,7 @@ gsk_rounded_rect_contains_point (const GskRoundedRect   *self,
     return FALSE;
 
   if (self->bounds.origin.x + self->corner[GSK_CORNER_BOTTOM_LEFT].width > point->x &&
-      self->bounds.origin.y + self->bounds.size.height - self->corner[GSK_CORNER_BOTTOM_LEFT].height > point->y &&
+      self->bounds.origin.y + self->bounds.size.height - self->corner[GSK_CORNER_BOTTOM_LEFT].height < point->y &&
       !ellipsis_contains_point (&self->corner[GSK_CORNER_BOTTOM_LEFT],
                                 &GRAPHENE_POINT_INIT (
                                     self->bounds.origin.x + self->corner[GSK_CORNER_BOTTOM_LEFT].width - point->x,
@@ -371,7 +371,7 @@ gsk_rounded_rect_contains_point (const GskRoundedRect   *self,
     return FALSE;
 
   if (self->bounds.origin.x + self->bounds.size.width - self->corner[GSK_CORNER_BOTTOM_RIGHT].width < point->x &&
-      self->bounds.origin.y + self->bounds.size.height - self->corner[GSK_CORNER_BOTTOM_RIGHT].height > point->y &&
+      self->bounds.origin.y + self->bounds.size.height - self->corner[GSK_CORNER_BOTTOM_RIGHT].height < point->y &&
       !ellipsis_contains_point (&self->corner[GSK_CORNER_BOTTOM_RIGHT],
                                 &GRAPHENE_POINT_INIT (
                                     self->bounds.origin.x + self->bounds.size.width - self->corner[GSK_CORNER_BOTTOM_RIGHT].width - point->x,